using UnityEngine;

public class ExplotionAtMouseclick : MonoBehaviour
{
	private Rigidbody[] rigidbodies;

	public float force;

	public float radius;

	private void Start()
	{
		rigidbodies = Object.FindObjectsOfType(typeof(Rigidbody)) as Rigidbody[];
	}

	private void Update()
	{
		if (Input.GetMouseButtonDown(0))
		{
			Vector3 mousePosition = Input.mousePosition;
			mousePosition.z = base.transform.position.z;
			Vector3 explosionPosition = Camera.main.ScreenToWorldPoint(mousePosition);
			Rigidbody[] array = rigidbodies;
			foreach (Rigidbody rigidbody in array)
			{
				rigidbody.AddExplosionForce(force, explosionPosition, radius);
			}
		}
	}
}
